﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public class PunchesWay
    {

        public int choice;

        private string name;

        public string Name { get => name; set => name = value; }
        public PunchesWay() { }
        public PunchesWay(int Choice)
        {
            this.Choice = Choice;

        }
        public int Choice { get => choice; set => choice = value; }

        /// <summary>
        ///     通过该方法判断玩家输赢
        /// </summary>
        /// <param name="name">电脑名字</param>
        /// <param name="num">输入的猜拳数字</param>
        public bool dc(string name, int num)
        {
            NPC n = new NPC();
            int num2 = n.adc();
            if (num == 1)
            {
                if (num2 == 1)
                {
                    Console.WriteLine("平局");
                    return true;
                }
                else if (num2 == 2)
                {
                    Console.WriteLine(name + "赢了");
                }
                else
                {
                    Console.WriteLine(this.name + "赢了");
                }


            }
            else if (num == 2)
            {
                if (num2 == 2)
                {
                    Console.WriteLine("平局");
                    return true;
                }
                else if (num2 == 1)
                {
                    Console.WriteLine(name + "赢了");
                }
                else
                {
                    Console.WriteLine(this.name + "赢了");
                }
            }
            else
            {
                if (num2 == 3)
                {
                    Console.WriteLine("平局");
                    return true;
                }
                else if (num2 == 2)
                {
                    Console.WriteLine(name + "赢了");
                }
                else
                {
                    Console.WriteLine(this.name + "赢了");
                }
            }
            return false;
        }
    }
}
